PR Title: Fixes #27345: Add usage count column to Classification tags table#27460
PR Title: Fixes #27345: Add usage count column to Classification tags table#27460karthik120710 wants to merge 6 commits intoopen-metadata:mainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi @karthik120710, thanks for the PR. For the UI changes, can you update the screenshot in the PR description for easy review? Also, your PR is missing tests, which is required. |
… to include usageCount functionality
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
@chirag-madlani can u review my pr. |
|
Hi @karthik120710 I gone throught this and it seems the param usageCount isn't pulling the right count, it seems always 0 so if we merge above changes still user won't be able to see the correct count. Can you ensure that count refalcts actual count and not just the adding the param? |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
@chirag-madlani i updated the changes in backend and added some unit test. |
|
@karthik120710 CI is failing after the commit please check those |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…t SQL injection Replace string formatting with JDBI named parameters (:tagFQN_i, :hash_i, :source). Introduces UsageCountQuery record to carry template + bindings, keeping the method testable. Tests updated to assert on bindings map rather than inline SQL literals. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved 1 resolved / 1 findingsAdds a usage count column to the classification tags table while addressing security concerns by replacing string-formatted SQL with parameterized queries. No further issues found. ✅ 1 resolved✅ Security: SQL built via string formatting instead of parameterized queries
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Fixes #27345
Added a new "Assets" (usage count) column to the common columns in ClassificationUtils.tsx. This column displays the usageCount field for
each tag, showing how many assets are associated with a given classification tag. The column falls back to the NO_DATA_PLACEHOLDER when the
value is null/undefined.
I worked on this because the tags table was missing visibility into how many assets reference each tag, which is useful for understanding
tag adoption and cleaning up unused tags.
Type of change:
Checklist:
Improvement checklist:
Screenshot/Preview: (please add a screenshot of the tags table showing the new "Assets" column)
Files changed:
image -

Summary by Gitar
buildUsageCountQueryinTagRepositoryto use parameterized SQL queries, effectively mitigating potential SQL injection risks.TagRepositoryUnitTestto validate the new parameter binding structure, ensuring correct usage of hashes and named parameters instead of literal string concatenation.This will update automatically on new commits.